#include<stdio.h>

int a[25][25];

int main()
{
	int n, m;	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			int t = i * i + j * j;
			printf("%6d", t);
		}
		printf("\n");
	}
	return 0;
}